package net.lanelife.casino.cms.web.controller;

import net.lanelife.casino.common.utils.BillNoUtils;
import net.lanelife.casino.common.utils.StringUtils;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping(value = "/search")
public class SearchController {

	@RequestMapping
	public String search(@RequestParam("query") String keyword) {
		String url = BillNoUtils.getSearchURL(keyword);
		if (StringUtils.isBlank(url)) {
			url = "/user?userName=" + keyword;
		}
		return "redirect:" + url;
	}
	
}
